back.controller('ImgStaticCtrl', function($scope, srv) {
    srv.queryAll(function(xhr) {
        if (!xhr.code) {
            console.log(xhr.msg);
        } else {
            console.log(xhr.msg);
        }
    });
    $scope.testUpload = function() {

    }
});

back.controller('ModalCtrl', ['$scope', '$uibModal', '$log', function($scope, $modal, $log) {
    $scope.items = ['内容一', '内容二', '内容三'];
    // $('#example').dataTable({
    //     "paging": false,
    //     "ordering": false,
    //     "info": false
    // });
    $scope.open = function(size) {
        var modalInstance = $modal.open({
            templateUrl: 'myModal.html',
            controller: 'ModalInstanceCtrl',
            size: size,
            resolve: {
                items: function() {
                    return $scope.items;
                }
            }
        });

        modalInstance.result.then(function(selectedItem) {
            $scope.selected = selectedItem;
        }, function() {
            $log.info('Modal dismissed at: ' + new Date());
        });
    };
}]);

back.controller('ModalInstanceCtrl', ['$scope', '$uibModalInstance', 'items', function($scope, $modalInstance, items) {
    $scope.items = items;
    $scope.selected = {
        item: $scope.items[0]
    };

    $scope.ok = function() {
        $modalInstance.close($scope.selected.item);
    };

    $scope.cancel = function() {
        $modalInstance.dismiss('cancel');
    };
}]);
